import { createStore } from 'vuex'
// 以插件的形式配置
import createPersistedstate from 'vuex-persistedstate'

import user from './modules/user.js'
import cart from './modules/cart.js'
import category from './modules/category.js'

export default createStore({
  // 数据结构
  state: {

  },
  // 修改数据
  mutations: {

  },
  // 异步操作函数(请求相关)
  actions: {
  },
  // 划分模块
  modules: {
    user,
    cart,
    category
  },
  // 计算属性
  getters: {

  },
  plugins: [
    createPersistedstate({
      key: 'erabbit-client-pc-store-60',
      paths: ['user', 'cart']
    })
  ]
})
